import { _decorator, Component, Node, Vec3, tween } from 'cc';
import { Constant } from '../Common/Constant';
import StorageManager from '../Common/StorageManager';
import { ZTool } from '../Common/ZTool';
import { UIManager } from '../Manager/UIManager';
const { ccclass, property } = _decorator;

@ccclass('StartScene')
export class StartScene extends Component {

    start() {
        StorageManager.ClearData();

        if (!StorageManager.GetBool(Constant.Key.AgreePolicy)) {
            UIManager.Instance.ShowPanel(Constant.Panel.PrivacyPanel);
        }
    }

    update(deltaTime: number) {
    }

    OnButtonClick(event, data) {
        switch (event.target.name) {
            case 'StartButton':
                UIManager.Instance.ShowPanel(Constant.Panel.TipPanel,
                    ["这是一个提示", Constant.Path.BatterySp, Constant.PropDesc.Battery, "确认", "取消", false]);

                //UIManager.Instance.ShowPanel(Constant.Panel.LoadingPanel, [Constant.Scene.Main]);
                break;
            case 'PrivacyButton':
                UIManager.Instance.ShowPanel(Constant.Panel.PrivacyPanel);
                break;
        }
    }
}


